# filter过滤类
# filter对可迭代对象进行过滤，得到一个filter对象

ages = [12, 34, 56, 23, 45, 56, 23, 12, 43, 15, 7, 1, 9]

# 语法：filter(函数, iterable)
new_ages = filter(lambda age: age > 18, ages)
print(new_ages)  # <filter object at 0x000001C4A0BCBE48>
# for adult_age in new_ages:
#     print(adult_age)
adult_ages = list(new_ages)
print(adult_ages)

